<%@page import="GetData.CharsetFilter"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Calendar"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<script>
    function cal()
    {
        var tcTong = document.getElementById("tstc");
        var tcLythuyet = document.getElementById("tclt");
        var tcThuchanh = document.getElementById("tcth");
        
        tcThuchanh.value = tcTong.value - tcLythuyet.value;
        
        
    }
</script>

<% request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html; charset=UTF-8"); 
    CharsetFilter ab=new CharsetFilter();
%>
<h1>THÊM MÔN HỌC</h1>
<%
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

//    Gets a calendar using the default time zone and locale.

Calendar c1 = Calendar.getInstance();
c1.set(2011, 11,11);
String date=sdf.format(c1.getTime());
//out.print(date);
%>

<form action="subject/add_subject_post.jsp" method="post">
    <table>
        <tr> 
            <td>MÃ MÔN HỌC:</td><td><input type="text" name="mamh"> </td>
        </tr>
        <tr> 
            <td>TÊN MÔN HỌC:</td><td> <input type="text" name="tenmh"></td>
        </tr>
        <tr> 
            <td>TỔNG SỐ TÍN CHỈ: </td>
            <td> <input type="text" id="tstc" name="tongsotc" onkeyup="cal()"></td>
        </tr>
        <tr> 
            <td>SỐ TÍN CHỈ LÝ THUYẾT :</td><td> <input id ="tclt" type="text" name="tclythuyet" onkeyup="cal()"></td>
        </tr>
        <tr> 
            <td>SỐ TÍN CHỈ THỰC HÀNH :</td><td> <input id="tcth" type="text" name="tcthuchanh" readonly="readonly">></td>
        </tr>
    <tr> 
            <td></td><td>  <input type="submit" name="addsubject" value="Thêm Môn học"></td>
        </tr>
   
    </table>
</form>